require(["config"],function(){
    require(["jquery","template","header"],function($, template){
        function Index(){
            this.render($);
        }
        Index.prototype={
            constructor:Index,
            //渲染商品列表
            render($){
              
                $.ajax("http://rap2api.taobao.org/app/mock/94933/pro/list")
                .done($.proxy(this.handleData,this));
            },
            handleData(data){
                console.log(data);
                var data = {list:data.res_body.list};
                var html = template("template",data);
                $(".products-list").html(html);
            },

            }
        
        new Index();
    });
});